package ThreadCommunication.ReentrantLock;

/**
 * @author dycong
 * @date 2018/5/5 19:21
 */
//取钱线程
public class DrawThread  extends Thread{
    // 账户
    private Account account;
    // 当前取钱线程希望去钱
    private double drawAmount;
    public DrawThread(String name, Account account, double drawAmount){
        super(name);
        this.account = account;
        this.drawAmount = drawAmount;
    }
    @Override
    public void run() {
        for (int i = 0; i < 100; i++) {
            account.draw(drawAmount);
        }
    }
}
